---
id: 6568bb656c67e9c54cced2d7
title: الخطوة 23
challengeType: 20
dashedName: step-23
---

# --description--

Now, you need to verify if the row is the last row inside a 3x3 square. This occurs when `index % 3` is equal to `2`.

Inside your existing `if` block, nest another `if` to check that condition.

# --hints--

You should have `if index % 3 == 2:` within the `if index < 8` statement.

```js
assert.match(code,/if\s+index\s*%\s*3\s*==\s*2\s*:/m)
```

# --seed--

## --seed-contents--

```py
class Board:
    def __init__(self, board):
        self.board = board

    def __str__(self):
        upper_lines = f'\n╔═══{"╤═══"*2}{"╦═══"}{"╤═══"*2}{"╦═══"}{"╤═══"*2}╗\n'
        middle_lines = f'╟───{"┼───"*2}{"╫───"}{"┼───"*2}{"╫───"}{"┼───"*2}╢\n'
        lower_lines = f'╚═══{"╧═══"*2}{"╩═══"}{"╧═══"*2}{"╩═══"}{"╧═══"*2}╝\n'
        board_string = upper_lines
        for index, line in enumerate(self.board):
            row_list = []
            for square_no, part in enumerate([line[:3], line[3:6], line[6:]], start=1):
                row_square = '|'.join(str(item) for item in part)
                row_list.extend(row_square)
                if square_no != 3:
                    row_list.append('║')

            row = f'║ {" ".join(row_list)} ║\n'
            row_empty = row.replace('0', ' ')
            board_string += row_empty
--fcc-editable-region--
            if index < 8:

--fcc-editable-region--
```
